package light3d;

public class GeometryBuilder 
{
	public static Triangle[] buildHorizontalPlane(double w, double h, double u, double v)
	{
		Triangle[] triangles = new Triangle[2];
		triangles[0] = new Triangle(BufferedCanvas.getRGBColor(255, 255, 255),
									0, 0, 0,
									w, 0, h,
									w, 0, 0);
		triangles[1] = new Triangle(BufferedCanvas.getRGBColor(255, 255, 255),
									0, 0, 0,
									w, 0, h,
									0, 0, h);									
		
		triangles[0].setBaseNormal(new Point3D(0, 1, 0));
		triangles[1].setBaseNormal(new Point3D(0, 1, 0));
		
		triangles[0].p[1].setUV(u, v);
		triangles[0].p[2].setUV(u, 0);
		
		triangles[1].p[1].setUV(u, v);
		triangles[1].p[2].setUV(0, v);
		
		return triangles;
	}
}
